package com.viewpagertext.DBHelper.Dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.viewpagertext.Model.User;
import com.viewpagertext.json.PlaybackMode;
import com.viewpagertext.json.StarredSong;

/**
 * @author ironjam
 * @version 1.0
 * @project AndroidMusic-master
 * @description 用于用户登录注册
 * @date 2024/6/6 14:38:54
 */
@Dao
public interface UserDao {
    @Query("insert into user(username,password) values(:username,:password) ")
    void insertUser(String username,String password);
    @Query("SELECT * FROM user WHERE UserName = :name AND PassWord = :password")
    User getUser(String name,String password);
    @Query("DELETE FROM user WHERE UserName = :name AND PassWord = :password")
    void deleteUser(String name,String password);
    @Update
    void updateUser(User user);
    @Query("SELECT * FROM user WHERE UserName = :name ")
    User getUserByusername(String name);
}
